package demo02;

import java.util.Date;
import java.util.Objects;

public class Video implements Cloneable{

    private String name;
    private Date crateTime;

    @Override
    protected Object clone() throws CloneNotSupportedException{
        Object obj = super.clone();

        Video v = (Video) obj;

        v.crateTime = (Date) this.crateTime.clone();//将这个对象的属性也进行克隆

        return  obj;

    }

    public Video(String name, Date crateTime) {
        this.name = name;
        this.crateTime = crateTime;
    }

    public Video() {
    }

    public Date getCrateTime() {
        return crateTime;
    }

    public void setCrateTime(Date crateTime) {
        this.crateTime = crateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "name=>"+ name +" Date=>" + crateTime;
    }
}
